<div class="canbos">
	<h2><?php __('Danh sách cán bộ');?></h2>
	<table class="table table-bordered table-consended table-hover">
	<tr class="info">
			<th><?php echo $this->Paginator->sort('STT','id');?></th>
			<th><?php echo $this->Paginator->sort('Mã số cán bộ','cb_maso');?></th>
			<th><?php echo $this->Paginator->sort('Họ tên','cb_hoten');?></th>
			<th><?php echo $this->Paginator->sort('Học vị','hocvi_id');?></th>
			<th><?php echo $this->Paginator->sort('Chức danh','chucdanh_id');?></th>
			<th><?php echo $this->Paginator->sort('Ngày sinh','cb_ngaysinh');?></th>
			<th><?php echo $this->Paginator->sort('Nơi sinh','cb_noisinh');?></th>
			<th><?php echo $this->Paginator->sort('Địa chỉ','cb_diachi');?></th>
			<th><?php echo $this->Paginator->sort('Giới tính','cb_gioitinh');?></th>
			<th><?php echo $this->Paginator->sort('Điện thoại','cb_dienthoai');?></th>
			<th><?php echo $this->Paginator->sort('Hệ số lương','cb_hsluong');?></th>
			<th><?php echo $this->Paginator->sort('Email','cb_email');?></th>
			<th><?php echo $this->Paginator->sort('Ghi chú','ghichu');?></th>
			<th class="actions"><?php __('Cập nhật');?></th>
	</tr>
	<?php
	$i = 0;
	foreach ($canbos as $canbo):
		// $class = null;
		// if ($i++ % 2 == 0) {
		// 	$class = ' class="altrow"';
		// }
	?>
	<tr>
		<td style="text-align:right"><?php echo $canbo['Canbo']['id']; ?>&nbsp;</td>
		<td style="text-align:center"><?php echo $canbo['Canbo']['cb_maso']; ?>&nbsp;</td>
		<td><?php echo $canbo['Canbo']['cb_hoten']; ?>&nbsp;</td>
		<td style="text-align:center">
			<?php echo $this->Html->link($canbo['Hocvi']['hvi_ten'], array('controller' => 'hocvis', 'action' => 'view', $canbo['Hocvi']['id'])); ?>
		</td>
		<td style="text-align:center">
			<?php echo $this->Html->link($canbo['Chucdanh']['cd_ten'], array('controller' => 'chucdanhs', 'action' => 'view', $canbo['Chucdanh']['id'])); ?>
		</td>
		
		<td style="text-align:center"><?php echo date('d-m-Y',strtotime($canbo['Canbo']['cb_ngaysinh'])); ?>&nbsp;</td>
		<td><?php echo $canbo['Canbo']['cb_noisinh']; ?>&nbsp;</td>
		<td><?php echo $canbo['Canbo']['cb_diachi']; ?>&nbsp;</td>
		<td style="text-align:center"><?php if($canbo['Canbo']['cb_gioitinh'] ==1) echo "Nam"; else echo "Nữ"; ?>&nbsp;</td>
		<td style="text-align:center"><?php echo $canbo['Canbo']['cb_dienthoai']; ?>&nbsp;</td>
		<td style="text-align:center"><?php echo $canbo['Canbo']['cb_hsluong']; ?>&nbsp;</td>
		<td><?php echo $canbo['Canbo']['cb_email']; ?>&nbsp;</td>
		<td><?php echo $canbo['Canbo']['ghichu']; ?>&nbsp;</td>
		<td class="actions">
		<button class="btn btn-success" onclick="window.location.href='<?php echo Router::url(array('action' => 'view', $canbo['Canbo']['id']))?>'"><i class="icon-zoom-in "></i></button>
            <button class="btn btn-info" onclick="window.location.href='<?php echo Router::url(array('action' => 'edit', $canbo['Canbo']['id']))?>'"><i class="icon-edit "></i></button>
            <button class="btn btn-danger" onclick="if(confirm('Có chắc bạn muốn xóa cán bộ <?= $canbo['Canbo']['cb_hoten'] ?>?')) window.location.href='<?php echo Router::url(array('action' => 'delete', $canbo['Canbo']['id']))?>'"><i class="icon-trash "></i></button>
			
		</td>
	</tr>
<?php endforeach; ?>
	</table>
	<p>
	<?php
	echo $this->Paginator->counter(array(
	'format' => __('Trang %page% của %pages%, hiển thị %current% dòng của tổng số %count% dòng, từ %start% đến %end%', true)
	));
	?>	</p>

	<div class="paging">
		<?php echo $this->Paginator->prev('<< ' . __('previous', true), array(), null, array('class'=>'disabled'));?>
	 | 	<?php echo $this->Paginator->numbers();?>
 |
		<?php echo $this->Paginator->next(__('next', true) . ' >>', array(), null, array('class' => 'disabled'));?>
	</div>
</div>
<div class="actions">
	<h3><?php __('Actions'); ?></h3>
	<ul>
		<li><?php echo $this->Html->link(__('Thêm cán bộ', true), array('action' => 'add')); ?></li>
		<li><?php echo $this->Html->link(__('Danh sách bộ môn', true), array('controller' => 'bomons', 'action' => 'index')); ?> </li>
		<li><?php echo $this->Html->link(__('Thêm bộ môn', true), array('controller' => 'bomons', 'action' => 'add')); ?> </li>
		<li><?php echo $this->Html->link(__('Danh sách học vị', true), array('controller' => 'hocvis', 'action' => 'index')); ?> </li>
		<li><?php echo $this->Html->link(__('Thêm học vị', true), array('controller' => 'hocvis', 'action' => 'add')); ?> </li>
		<li><?php echo $this->Html->link(__('Danh sách chức danh', true), array('controller' => 'chucdanhs', 'action' => 'index')); ?> </li>
		<li><?php echo $this->Html->link(__('Thêm chức danh', true), array('controller' => 'chucdanhs', 'action' => 'add')); ?> </li>
		<li><?php echo $this->Html->link(__('Danh sách học viên hướng dẫn', true), array('controller' => 'canbohocviens', 'action' => 'index')); ?> </li>
		<li><?php echo $this->Html->link(__('Danh sách đề tài đã ra', true), array('controller' => 'detaicanbos', 'action' => 'index')); ?> </li>
		
	</ul>
</div>